
# 1 有嵌套
def print_info(myfunc):

    def fun_in(*args, **kwargs):

        # 4 添加额外功能
        print('[友情提示]正在计算...')

        # 2 有引用
        result = myfunc(*args, **kwargs)
        return result

    # 3 有返回
    return fun_in


@print_info   #     get_sum = print_info(get_sum)
def get_sum(*args, **kwargs):
    sum = 0

    for value in args:
        sum = sum + value

    for value in kwargs.values():
        sum = sum + value

    return sum


result = get_sum(1, 2, 3, a=10, b=20, c=30)
print(result)